<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<% response.setHeader("Cache.Control","no-cache"); response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires",0);%>
<jsp:useBean id="action" scope="request"
	class="swd.basic.conf_prg_info.Action" />
<jsp:useBean id="view" scope="request"
	class="swd.basic.conf_prg_info.View" />
<jsp:setProperty name="view" property="*" />

<%if (action.action(pageContext).equals("login")){return;} %>
<jsp:useBean id="DataView" scope="request"
	type="com.pub.database.DataView" />
<!-- 以下為DataView 共用設定 -->
<jsp:useBean id="DataViewForm" scope="request"
	type="com.pub.database.DataViewForm" />
<jsp:setProperty name="DataViewForm" property="submitMethod"
	value="POST" />
<jsp:setProperty name="DataViewForm" property="pageRowCount" value="0" />
<jsp:setProperty name="DataViewForm" property="nowPageNum" />
<jsp:setProperty name="DataViewForm" property="dataViewAction" />
<jsp:setProperty name="DataViewForm" property="filterCol" />
<jsp:setProperty name="DataViewForm" property="filterValue" />
<jsp:setProperty name="DataViewForm" property="dvOrderByFields" />
<jsp:setProperty name="DataViewForm" property="dvOrderBySeq" />
<!-- DataView 設定結束 -->

<html>
<head>
<title><%=view.getPrgTitle()%></title>
<LINK HREF="/SWD/workflow.css" REL="STYLESHEET" TYPE="TEXT/CSS">
<script type="text/javascript" language="javascript1.2"
	src="/PUBPAGE/general/commscript.js"></script>
<script type="text/javascript" language="javascript1.2"
	src="/PUBPAGE/general/commhtmlscript.js"></script>
<SCRIPT type="text/javascript" LANGUAGE="javascript1.2"
	SRC="/SWD/general/swd.js"></SCRIPT>
</head>
<script language="javascript" type="text/javascript">
      // 取得系統代號
      function fc_get_sys_data(obj1){
           ret=window.showModalDialog("/SWD/pages/pub/find_wkf_sys.jsp","_blank","status:no");

           if(ret==null){return;}
           val=ret.split(',,,,,');
           if (obj1.value==''){
              obj1.value=val[0];
           }else {
              obj1.value=obj1.value + "," + val[0];
           }
      }

      // 取得群組代號
      function fc_get_group_data(obj1){
           ret=window.showModalDialog("/SWD/pages/pub/find_wkf_user_by_group.jsp","_blank","status:no");
           if(ret==null){return;}
           val=ret.split(',,,,,');
           if (obj1.value==''){
              obj1.value=val[0];
           }else {
              obj1.value=obj1.value + "," + val[0];
           }
      }

      // 取得表格名稱
      function fc_get_table_data(obj1){
           ret=window.showModalDialog("/SWD/pages/pub/find_wkf_table.jsp","_blank","status:no");
           if(ret==null){return;}
           val=ret.split(',,,,,');
           if (obj1.value==''){
              obj1.value=val[0];
           }else {
              obj1.value=obj1.value + "," + val[0];
           }
      }

      function saveRowSn(rowsn){
         if(document.all.item('rowsn').value.indexOf(rowsn)>-1){
            return;//已記錄過就不再記錄了
         }
         if(document.all.item('rowsn').value==''){
           document.all.item('rowsn').value=rowsn;
         } else{
           document.all.item('rowsn').value=document.all.item('rowsn').value + ',' + rowsn;
         }
      }

      function fc_save_before_check(){
         // 程式編號
         if (document.all.item('prg_no').value==""){
            alert("程式編號沒有值!!");
            return;
         }

         // 流程單別
         if (document.all.item('flow_code').value==""){
            alert("流程單別沒有值!!");
            return;
         }

         // 加入系統
         if (document.all.item('join_sys').value==""){
            alert("加入系統沒有值!!");
            return;
         }

         // 異動檔案
         if (document.all.item('dbf_no').value==""){
            alert("異動檔案沒有值!!");
            return;
         }

         // 加入群組
         if (document.all.item('join_group').value==""){
            alert("加入群組沒有值!!");
            return;
         }

         // 中文名稱document.all.item('wo_rout0').checked
         if ((!document.all.item('prg_kind0').checked)&&
             (!document.all.item('prg_kind1').checked)&&
             (!document.all.item('prg_kind2').checked)&&
             (!document.all.item('prg_kind3').checked)){
            alert("程式類別沒有勾選!!");
            return;
         }

         // 中文名稱
         if (document.all.item('prg_name').value==""){
            alert("中文名稱沒有值!!");
            return;
         }

         // 英文名稱
         if (document.all.item('prg_name_e').value==""){
            alert("英文名稱沒有值!!");
            return;
         }

         document.all.item('prgAction').value='save';
         document.forms[0].submit();
      }
</script>
<body bgcolor="#ffffff" onload="<%=view.getOnloadScript()%>">
<TABLE BORDER="0" HEIGHT="20" CELLPADDING="0" CELLSPACING="0">
	<TR>
		<TD BACKGROUND="/SWD/pub_images/title_bg.gif">
		<DIV ALIGN="LEFT"><IMG SRC="/SWD/pub_images/title01.gif"
			WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /><IMG
			SRC="/SWD/pub_images/glass.gif" WIDTH="12" HEIGHT="8" alt="" /></DIV>
		</TD>
		<TD ALIGN="LEFT" HEIGHT="20" VALIGN="MIDDLE"
			BACKGROUND="/SWD/pub_images/title_bg.gif" CLASS="TITLE">步驟4、建立程式</TD>
		<TD BACKGROUND="/SWD/pub_images/title_bg.gif">
		<DIV ALIGN="RIGHT"><IMG SRC="/SWD/pub_images/glass.gif"
			WIDTH="12" HEIGHT="8" alt="" /><IMG SRC="/SWD/pub_images/title02.gif"
			WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /></DIV>
		</TD>
	</TR>
</TABLE>
<br />
<form action="conf_prg_info.jsp" method="POST">


<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0" style="">
	<TR>
		<TD style="" width="5%"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnAddTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:document.all.item('prgAction').value='add';document.forms[0].submit();" /></TD>
		<TD style="" width="5%"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnQueryTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:document.all.item('prgAction').value='query';document.forms[0].submit();" /></TD>
		<TD style="" width="5%"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnSaveTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:fc_save_before_check();" /></TD>
		<TD style="" width="5%"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnExitTitle()%>" CLASS="button b_normal"
			onClick="document.location.href='conf_prg_info.jsp'" /></TD>
		<TD width="80%">&nbsp;</TD>
	</TR>
	<TR>
		<TD colspan=5><font color="red"><%=(view.getTipMessage()!=null ? "工作提示:"+ view.getTipMessage() : "")%></font>
		</TD>
	</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0">
	<TR>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getprg_noTitle()%></TD>
		<TD WIDTH="80%" CLASS="td_content" colspan=3><INPUT TYPE="TEXT"
			NAME="prg_no" SIZE="25" MAXLENGTH="40"
			VALUE="<%=(view.getprg_no()!=null ? view.getprg_no() : "")%>"
			<%=view.getprg_no_readonly() ? "readonly" : "onDblClick=\"fc_get_wkf_prg_data(this);\""%>
			CLASS="<%=(view.getprg_no_readonly() ? "input_noborder" : "input_window hand")%>" />

		</TD>
	</TR>
	<TR style="">
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getflow_codeTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="flow_code" SIZE="3" MAXLENGTH="3"
			VALUE="<%=(view.getflow_code()!=null ? view.getflow_code() : "")%>"
			<%=view.getflow_code_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getflow_code_readonly() ? "input_noborder" : "input")%>" />
		</TD>
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getflow_ynTitle()%></TD>
		<TD WIDTH="80%" CLASS="td_content"><SELECT NAME="flow_yn"
			SIZE="1"
			onfocus="javascript:if(<%=view.getflow_yn_readonly()%>==1){this.blur();}"
			CLASS="select">
			<OPTION VALUE="Y"
				<%if(view.getflow_yn() !=null){out.print((view.getflow_yn().equals("Y") ? "selected" : ""));}%>>是</OPTION>
			<OPTION VALUE="N"
				<%if(view.getflow_yn() !=null){out.print((view.getflow_yn().equals("N") ? "selected" : ""));}%>>否</OPTION>
		</SELECT></TD>
	</TR>
	<TR style="">
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getprg_kindTitle()%></TD>
		<TD WIDTH="80%" CLASS="td_content" colspan="3"><INPUT
			TYPE="CHECKBOX" NAME="prg_kind0" VALUE="D" CLASS="checkbox"
			<%if(view.getprg_kind0()!=null){out.print((view.getprg_kind0().equals("D") ? "checked" : ""));}%>
			<%=view.getprg_kind_readonly() ? "disabled" : ""%> />新增頁 <INPUT
			TYPE="CHECKBOX" NAME="prg_kind1" VALUE="Y" CLASS="checkbox"
			<%if(view.getprg_kind1()!=null){out.print((view.getprg_kind1().equals("Y") ? "checked" : ""));}%>
			<%=view.getprg_kind_readonly() ? "disabled" : ""%> />簽核頁 <INPUT
			TYPE="CHECKBOX" NAME="prg_kind2" VALUE="R" CLASS="checkbox"
			<%if(view.getprg_kind2()!=null){out.print((view.getprg_kind2().equals("R") ? "checked" : ""));}%>
			<%=view.getprg_kind_readonly() ? "disabled" : ""%> />查詢頁 <INPUT
			TYPE="CHECKBOX" NAME="prg_kind3" VALUE="K" CLASS="checkbox"
			<%if(view.getprg_kind3()!=null){out.print((view.getprg_kind3().equals("K") ? "checked" : ""));}%>
			<%=view.getprg_kind_readonly() ? "disabled" : ""%> />外掛</TD>
	</TR>
	<TR style="">
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getjoin_sysTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="join_sys" SIZE="25" MAXLENGTH="40"
			VALUE="<%=(view.getjoin_sys()!=null ? view.getjoin_sys() : "")%>"
			<%=view.getjoin_sys_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getjoin_sys_readonly() ? "input_noborder" : "input_window hand")%>"
			onDblClick="fc_get_sys_data(this);" /></TD>
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getjoin_groupTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="join_group" SIZE="25" MAXLENGTH="40"
			VALUE="<%=(view.getjoin_group()!=null ? view.getjoin_group() : "")%>"
			<%=view.getjoin_group_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getjoin_group_readonly() ? "input_noborder" : "input_window hand")%>"
			onDblClick="fc_get_group_data(this);" /></TD>
	</TR>
	<TR style="">
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getdbf_noTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="dbf_no" SIZE="25" MAXLENGTH="40"
			VALUE="<%=(view.getdbf_no()!=null ? view.getdbf_no() : "")%>"
			<%=view.getdbf_no_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getdbf_no_readonly() ? "input_noborder" : "input_window hand")%>"
			onDblClick="fc_get_table_data(this);" /></TD>
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getprg_nameTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="prg_name" SIZE="25" MAXLENGTH="40"
			VALUE="<%=(view.getprg_name()!=null ? view.getprg_name() : "")%>"
			<%=view.getprg_name_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getprg_name_readonly() ? "input_noborder" : "input")%>" />
		</TD>
	</tr>
	<TR style="">
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getprg_name_eTitle()%></TD>
		<TD WIDTH="80%" CLASS="td_content" colspan="3"><INPUT
			TYPE="TEXT" NAME="prg_name_e" SIZE="40" MAXLENGTH="40"
			VALUE="<%=(view.getprg_name_e()!=null ? view.getprg_name_e() : "")%>"
			<%=view.getprg_name_e_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getprg_name_e_readonly() ? "input_noborder" : "input")%>" />
		</TD>
	<tr>

	</tr>
</TABLE>
<INPUT TYPE="HIDDEN" NAME="flow_yn" SIZE="1" MAXLENGTH="1"
	VALUE="<%=(view.getflow_yn()!=null ? view.getflow_yn() : "")%>" /> <INPUT
	TYPE="HIDDEN" NAME="btn_pos" SIZE="1" MAXLENGTH="1"
	VALUE="<%=(view.getbtn_pos()!=null ? view.getbtn_pos() : "")%>" /> <INPUT
	TYPE="HIDDEN" NAME="flow_copy" SIZE="3" MAXLENGTH="3"
	VALUE="<%=(view.getflow_copy()!=null ? view.getflow_copy() : "")%>" />
<INPUT TYPE="HIDDEN" NAME="prgAction" VALUE="<%=view.getPrgAction()%>" />
<INPUT TYPE="HIDDEN" NAME="prgStatus" VALUE="<%=view.getPrgStatus()%>" />
<INPUT TYPE="HIDDEN" NAME="flowAction" VALUE="<%=view.getFlowAction()%>" />
<INPUT TYPE="HIDDEN" NAME="flowStatus" VALUE="<%=view.getFlowStatus()%>" />
<br />
<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0" style="">
	<tr>
		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnSaveAllTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:document.all.item('prgAction').value='saveall';document.forms[0].submit();" /></TD>
	</tr>
	<tr>
		<td>
		<% DataView.OutputDataView(DataViewForm, pageContext);%>
		</td>
	</tr>
</TABLE>
</form>
</body>
</html>
